package puzzlegame.TEST;

import javax.swing.*;
import java.util.Random;

public class registerJFrame extends JFrame {
    public registerJFrame() {
        this.setSize(488, 500);
        //设置界面标题
        this.setTitle("注册");
        //界面置顶   this.setAlwaysOnTop(true);
        //设置界面居中
        this.setLocationRelativeTo(null);
        //设置游戏的关闭模式,(3)是关闭任意一个界面并停止运行。(2)是关闭所有界面停止运行
        this.setDefaultCloseOperation(3);
        //显示界面
        this.setVisible(true);
    }

   /* private void identifycode(){
        char[] chs = new char[52];
        for (int i = 0; i < chs.length; i++) {
            if (i <= 25) {
                //小写字母
                chs[i] = (char) (97 + i);
            } else {
                //当i>26时,添加大写字母
                chs[i] = (char) (65 + i - 26);
            }
        }
    /* for (int i = 0; i < chs.length; i++) {
         System.out.print(chs[i] + " ");
     }
        String result = "";
        Random r = new Random();
        for (int i = 0; i < 4; i++) {
            int randomIndex = r.nextInt(chs.length);
            result = result + chs[randomIndex];
        }
        //System.out.print(result);
        int number = r.nextInt(10);
        result = result + number;
        System.out.println(result);
    }
    */
}

